package com.mingqi.enetconnected.primary.mytask.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.mingqi.enetconnected.R;
import com.mingqi.enetconnected.data.bean.order.GoodsOrder;
import com.mingqi.enetconnected.util.AmountTranslateUtil;

import java.util.List;

/**
 * 任务详情-服务内容-服务项目
 *
 * @author yaxi
 * @date 2018/9/14
 */
public class ServiceItemAdapter extends BaseQuickAdapter<GoodsOrder, BaseViewHolder> {
    public ServiceItemAdapter(@Nullable List<GoodsOrder> data) {
        super(R.layout.item_service_recycler, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, GoodsOrder item) {

        String paidStr = AmountTranslateUtil.decorate(AmountTranslateUtil.transformAmount(item.getPaidFee()));
        String productName = item.getProductName();
        helper.addOnClickListener(R.id.iv_amount_edit);
        if (productName != null) {
            helper.setText(R.id.tv_service_content_name, productName);
        }

        helper.setText(R.id.service_amount, paidStr);

    }

    @Override
    public void setNewData(@Nullable List<GoodsOrder> data) {
        super.setNewData(data);
    }
}
